package copyengine.ui
{
	import copyengine.utils.debug.CELog;

	import flash.display.Sprite;

	/**
	 *CESprite is all CopyEngine UI Component root class.
	 * all component (Button , List , Panel etc) should extends this class.
	 * <br><br>
	 * this class will provide basic init/destory function, if child class need more operater
	 * then can override initialize/dispose function.
	 * <br><br>
	 *
	 * @author Tunied
	 *
	 */
	public class CESprite extends Sprite
	{
		protected var isDispose:Boolean = false;

		public function CESprite()
		{
			super();
		}

		public final function dispose():void
		{
			if (!isDispose)
			{
				doDispose();
			}
			isDispose = true;
		}

		protected function doDispose():void
		{
			CELog.err(this.toString() + "  Should Override this function to dispose");
		}

	}
}